Centrallix - It's Different than what you Think
Home   |   Technology   |   Screen Shots   |   Download   |   Documentation   |   History   |   For Developers

Search...


Search For:

Index...


Centrallix Documentation

11.14 MySQL DB Connector


Database Connector to MySQL Server

As with other kinds of remote data access, Centrallix requires a "node object" in the ObjectSystem to represent the connectivity to the remote resource. This section describes the connector used for MySQL database resources.


Usage

The MySQL connector is a structure file, and it must carry the extension ".mysdb" to be recognized by the ObjectSystem. Alternatively, it can be stored in a location (for example, a MIME document with attachments) which keeps the resource type ("application/mysql" in this case) along with the resource.


Passwords and Accounts

Centrallix provides several options on how it should authenticate to the MySQL server.

The first option is to use a static username and password for all connections; in that case, the username and password are stored in the MySQL connector node.

Alternatively, Centrallix can use the user's Centrallix login credentials when connecting to the database server. Note that in that case, the database server must be a trusted server, to avoid a compromise of the user's login credentials. In the default configuration file, however, the option enable_send_credentials is set to 0 so that Centrallix will refuse to send the user's Centrallix login password to a MySQL server.


Primary Keys

Centrallix requires that all tables have primary keys. If your database is not already set up with primary keys on each table they must be added before you database will work properly in Centrallix. One way to do this is to use the 'ALTER TABLE' SQL query. Information on the proper syntax to use can be found here: http://dev.mysql.com/doc/refman/5.0/en/alter-table.html


Object Model

The MySQL driver presents the contents of the remote database using a conventional Centrallix object model for relational data sources:

DatabaseNode.mysdb/TableName/{rows|columns}/{columnname|rowname}


For example, to access a single row object by name (in this case, a row with primary key value '1000' in the Account table in a database referenced by connector node DatabaseNode.mysdb):

/datasources/DatabaseNode.mysdb/Account/rows/1000


To query for rows in the same table, an SQL SELECT statement might look like:

SELECT * from /datasources/DatabaseNode.mysdb/Account/rows



Properties

Below is a list of the properties used in a MySQL connector node.

PropertyTypeDefaultDescription
databasestring(none)The name of the database to use on the remote server.
serverstring(none)The name of the database server to use, from the MySQL "interfaces" file.
max_connectionsinteger16The maximum number of connections that this driver will make to the remote database. This number can range from 1 to 256.
annot_tablestring(none)The table to use as the "annotation table". This table should have three columns named a, b, and c. 'a' should be the name of the table, 'b' should be a brief description of the table, and 'c' is an expression to evaluate which will give a description of a row in the table. Though this feature is planned, it has not yet been implemented.
use_system_authyes/nonoWhether to use the Centrallix login username and password to log into the database server. If set to "no", then Centrallix will use the username and password that are supplied in the MySQL connector node. This option cannot be set to "yes" if the Centrallix system-wide enable_send_credentials option is set to 0.
set_passwordsyes/nonoIf use_system_auth is set to yes, this can be used to perform initial synchronization of MySQL database passwords with the Centrallix login passwords. Should a user's login fail, Centrallix will attempt to login with a default password instead. If the default password login succeeds, then Centrallix will change the user's password to no longer be the default and instead be the user's Centrallix login password.
usernamestringcxguestIf use_system_auth is not enabled, this provides the login username that Centrallix will use for the MySQL database server.
passwordstring(empty)If use_system_auth is not enabled, this provides the login password that Centrallix will use for the MySQL database server.
default_passwordstring(empty)If use_system_auth is enabled, this provides the login password that Centrallix will use for the MySQL database server if the user's normal Centrallix login password does not work. Note that this will occur regardless of whether set_passwords is enabled or not.



Sample Connector Node

Here is a sample MySQL connector node which connects to the database MyDatabase on localhost. It uses a user's Centrallix system login credentials to connect to the server, and sets a limit of 50 connections.

$Version=2$
My_DB "application/mysql"
    {
    server = localhost;
    database = "MyDatabase";
    max_connections = 50;
    use_system_auth = yes;
    default_password = "";
    }



MySQL is a registered trademark of Sun Microsystems, Inc.

Comments...


(none yet)

Add a Comment...


Your Name:
Comment:


(c) 2001-2020 LightSys Technology Services, Inc. All trademarks are property of their respective owners.

Project Hosting Provided By:
Hosted by Sourceforge